using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace CubicFWNet.Data.Models.Mapping
{
    public class RelationMap : EntityTypeConfiguration<Relation>
    {
        public RelationMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            this.Property(t => t.TypeId)
                .HasMaxLength(128);

            // Properties
            // Table & Column Mappings
            this.ToTable("Relation");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.TypeId).HasColumnName("TypeId");
            this.Property(t => t.FirstId).HasColumnName("FirstId");
            this.Property(t => t.SecondId).HasColumnName("SecondId");
        }
    }
}
